/*
 *  Emotion Media Center
 *
 *  Copyright (C) 2009 Davide Andreoli <dave@gurumeditation.it>
 *
 *  License LGPL-2.1, see COPYING file at project folder.
 *
 */

#include "emc.h"
#include "emc_module.h"
#include "emc_input.h"
#include "emc_mainmenu.h"
#include "emc_browser_obj.h"
#include "emc_gui.h"
#include "emc_strbuf.h"

#define EMC_MODULE_NAME "video_tvshow"

#define LOCAL_DEBUG 1
#if LOCAL_DEBUG
#define D DBG
#else
#define D(...)
#endif


/*****************************************************************************/
/*                         internals                                         */
/*****************************************************************************/

//~ static void
//~ _browser_selected_cb(void *data, Evas_Object *obj, void *event_info)
//~ {
   //~ Emc_Browser_Item *item = event_info;
   //~ Eina_List *list = NULL;
//~ 
   //~ D("SEL!! %s", item->label);
   //~ if (item->is_dir)
   //~ {
      //~ if (!strcmp(item->uri, "mame:my"))
         //~ list = _my_games_list();
      //~ else if (!strcmp(item->uri, "mame:all"))
         //~ list = _all_games_list();
         //~ 
      //~ emc_browser_obj_push(obj, list, EINA_TRUE);
   //~ }
   //~ else
   //~ {
      //~ _mame_run_game(item->uri);
   //~ }
//~ }

//~ static void
//~ _mame_show(void *data)
//~ {
   //~ Evas_Object *brow;
   //~ Eina_List *list = NULL;
   //~ Emc_Browser_Item *item;
   //~ 
   //~ brow = emc_browser_obj_add(evas_object_evas_get(emc->layout));
   //~ evas_object_smart_callback_add(brow, "selected", _browser_selected_cb, NULL);
//~ 
   //~ item = emc_browser_item_new("mame:my", "My Games", NULL, EINA_TRUE);
   //~ list = eina_list_append(list, item);
//~ 
   //~ item = emc_browser_item_new("mame:all", "All Games", NULL, EINA_TRUE);
   //~ list = eina_list_append(list, item);
//~ 
   //~ item = emc_browser_item_new("mame:fav", "Favorite Games", NULL, EINA_TRUE);
   //~ list = eina_list_append(list, item);
//~ 
   //~ emc_browser_obj_push(brow, list, EINA_FALSE);
   //~ emc_gui_content_show(brow);
//~ }

/******************************************************************************/
/*                     Module interface                                       */
/******************************************************************************/

Eina_Bool
module_init(Emc_Module *em)
{
   Evas_Object *ic;
   
   D(" ");

   ic = elm_icon_add(emc->win);
   elm_icon_file_set(ic, emc->theme_file, "icon/video");
   emc_mainmenu_item_append("videos_tvshow", "TV Shows", ic, "videos", 1,
                            NULL, NULL);

   return EINA_TRUE;
}

Eina_Bool
module_shutdown(Emc_Module *em)
{
   D(" ");

   emc_mainmenu_item_del("videos_tvshow");
   return EINA_TRUE;
}

Emc_Module_Api module_api =
{
   EMC_MODULE_API_VERSION,
   EMC_MODULE_NAME,
   "TV Shows",
   NULL,
   "Module to play TV Shows",
   "bla bla bla<br><b>bla bla bla</b><br><br>bla.",
   {
      module_init,
      module_shutdown
   }
};
